package com.yingxin.yxerp.module.permission.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yingxin.yx.framework.user.dto.AppPermissionDto;
import com.yingxin.yxerp.module.permission.entity.AppPermission;
import com.yingxin.yxerp.module.permission.vo.req.AppPermissionQueryVo;
import com.yingxin.yxerp.module.permission.vo.resp.AppPermissionRespVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * app功能权限 Mapper 接口
 * </p>
 *
 * @author matongtong
 * @since 2023-12-04
 */
public interface AppPermissionMapper extends BaseMapper<AppPermission> {

    /**
     * 分页查询
     * @param page
     * @param queryObj
     * @return
     */
    IPage<AppPermissionRespVo> pageVo(Page page, @Param("queryObj") AppPermissionQueryVo queryObj);

    /**
     * 查询全部
     * @param queryObj
     * @return
     */
    List<AppPermissionRespVo> listVo(@Param("queryObj") AppPermissionQueryVo queryObj);

    /**
     * 根据id查询
     * @param id
     * @return
     */
    AppPermissionRespVo getVo(@Param("id") String id);

    /**
     * app应用权限
     * @return
     */
    List<AppPermissionDto> listAppPermissionDto();

    List<AppPermissionDto> listDtoByRoleId(@Param("roleId") String roleId);
    void saveTempPermissions(List<AppPermission> list);
}
